// to grade students

# include <iostream.h>
# include <conio.h>

class MarkSheet {
  char name[30];
  int rollNo, mark1, mark2, mark3, mark4, mark5, total;
  float average;
public:
  void getDetails();
  char getGrade();
  void displayMarkSheet();
};

void MarkSheet::getDetails() {
  cout << "Enter Student Name: ";
  cin >> name;
  cout << "Enter RollNo: ";
  cin >> rollNo;
  cout << "Enter Tamil Mark: ";
  cin >> mark1;
  cout << "Enter English Mark: ";
  cin >> mark2;
  cout << "Enter Maths Mark: ";
  cin >> mark3;
  cout << "Enter Science Mark: ";
  cin >> mark4;
  cout << "Enter Social Mark: ";
  cin >> mark5;
  total = mark1 + mark2 + mark3 + mark4 + mark5;
  average = total/5;
}

char MarkSheet::getGrade() {
  if(average < 60) {
    return 'C';
  }
  else if (average < 80) {
    return 'B';
  }
  else {
    return 'A';
  }
}

void MarkSheet::displayMarkSheet() {
  cout << "*******************************************************" << endl;
  cout << "Name: " << name << "\tRoll No:" << rollNo << endl;
  cout << "*******************************************************" << endl;
  cout << "Tamil \t\t: \t" << mark1 << endl;
  cout << "English \t: \t" << mark2 << endl;
  cout << "Maths \t\t: \t" << mark3 << endl;
  cout << "Science \t: \t" << mark4 << endl;
  cout << "Social \t\t: \t" << mark5 << endl;
  cout << "Total \t\t: \t" << total << endl;
  cout << "Average \t: \t" << average << endl;
  cout << "Your Grade is \t: \t" << getGrade() << endl;
  cout << "*******************************************************" << endl;
}

void main() {
  clrscr();
  MarkSheet ms;
  ms.getDetails();
  clrscr();
  ms.displayMarkSheet();
  getch();
}